#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n = 0;
    cin >> n;
    int count = 0;
    while (n)
    {
        string s1(to_string(n));
        int flag = 1;
        for (int i = s1.size() - 1; i >= 0; --i)
        {
            if (s1[i] % 2 != flag)
            {
                break;
            }
            if (i == 0)
                ++count;
            flag = flag ? 0 : 1;
        }
        --n;
    }

    cout << count;
    return 0;
}